//
//  HotThirdCell.m
//  HomePage
//
//  Created by dlios on 15-1-29.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "HotThirdCell.h"
#import "UIImageView+WebCache.h"
@implementation HotThirdCell


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)prepareForReuse{
    self.buttonImageview.layer.cornerRadius = 35;
    [self.buttonImageview setImage:[UIImage imageNamed:@"iconfont-bofang.png"] forState:UIControlStateNormal];

    
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageViewBack = [[UIImageView alloc] init];
        self.buttonImageview = [UIButton buttonWithType:UIButtonTypeSystem];
        
        self.labelTitle = [[UILabel alloc] init];
        self.imageViewPhoto = [[UIImageView alloc] init];
//        self.shareButton = [[UIButton alloc] init];
//        self.shareButton.frame = CGRectMake(328, 38, 60, 30);
//        [self.shareButton setTitle:@"分享" forState:UIControlStateNormal];
//        self.shareButton.backgroundColor = [UIColor blueColor];
//        [self.imageViewBack addSubview:self.shareButton];
        self.imageViewBack.userInteractionEnabled = YES;
        self.imageViewPhoto.userInteractionEnabled = YES;
        self.buttonImageview.layer.cornerRadius = 30;
        [self.buttonImageview setImage:[UIImage imageNamed:@"iconfont-bofang.png"] forState:UIControlStateNormal];
        [self.imageViewPhoto addSubview:self.buttonImageview];
        
        
        
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.buttonImageview.frame = CGRectMake(0, 0, self.contentView.frame.size.height / 1.125, self.contentView.frame.size.height / 1.125);
    
    self.contentView.backgroundColor = [UIColor colorWithRed:225/255.0 green:237/255.0 blue:238/255.0 alpha:1];
    self.imageViewBack.frame = CGRectMake(self.contentView.frame.size.width / 75, self.contentView.frame.size.height / 18, self.contentView.frame.size.width, self.contentView.frame.size.height / 1.125);
    self.imageViewBack.image = [UIImage imageNamed:@"white.png"];
    [self.contentView addSubview:self.imageViewBack];
    self.labelTitle.frame = CGRectMake(self.contentView.frame.size.width / 4.17, self.contentView.frame.size.height / 6.67, self.contentView.frame.size.width / 2, self.contentView.frame.size.height / 1.5);
    self.labelTitle.numberOfLines = 0;
    self.labelTitle.font = [UIFont systemFontOfSize:15];
    self.labelTitle.text = self.thirdHot.title;
    [self.imageViewBack addSubview:self.labelTitle];
    self.imageViewPhoto.frame = CGRectMake(0, 0, self.contentView.frame.size.height / 1.125, self.contentView.frame.size.height / 1.125);
    self.imageViewPhoto.layer.cornerRadius = 30;
    self.imageViewPhoto.layer.masksToBounds = YES;
//    NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
    //[center addObserver:self selector:@selector(PhotoChange) name:@"change" object:nil];
       [self.imageViewBack addSubview:self.imageViewPhoto];
    
}
//- (void)PhotoChange
//{
//    
//    [self.buttonImageview setImage:[UIImage imageNamed:@"iconfont-zanting.png"] forState:UIControlStateNormal];
//}
@end
